<include file="public@header"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-page-header">
            <div class="layui-card">
                <div class="layui-page-header-content">
                    <div class="layui-card-body">
                        <div class="layui-ui-page-header-title" >
                            友情链接<span class="layui-badge-rim page-content">网站友情链接添加及编辑</span>
                        </div>
                    </div>
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-tab-title">
                            <li class="layui-this"><a href="{:url('link/index')}">所有友情链接</a></li>
                            <li><a href="javascript:admin.openIframeLayer('{:url('link/add')}','添加友情链接',{btn: ['保存','关闭'],area:['640px','50%'],end:function(){location.reload();}});">添加友情链接</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-page-content js-check-wrap">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form method="post" class="layui-form js-ajax-form" action="{:url('Link/listOrder')}">
                        <div class="layui-btn-container">
                            <button class="layui-btn layui-btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
                            <button class="layui-btn layui-btn-sm js-ajax-submit" type="submit"
                                    data-action="{:url('link/toggle',array('display'=>1))}" data-subcheck="true">{:lang('DISPLAY')}
                            </button>
                            <button class="layui-btn layui-btn-sm js-ajax-submit" type="submit"
                                    data-action="{:url('link/toggle',array('hide'=>1))}" data-subcheck="true">{:lang('HIDE')}
                            </button>
                        </div>
                        <php>$status=array("1"=>lang('DISPLAY'),"0"=>lang('HIDDEN'));</php>
                        <table class="layui-table" lay-even lay-size="lg">
                            <thead>
                            <tr>
                                <th width="16">
                                    <input lay-skin="primary" type="checkbox" class="js-check-all" lay-filter="js-check-all" data-direction="x" data-checklist="js-check-x">
                                </th>
                                <th width="50">{:lang('SORT')}</th>
                                <th width="50">ID</th>
                                <th>{:lang('NAME')}</th>
                                <th>链接地址</th>
                                <th>{:lang('STATUS')}</th>
                                <th width="112">{:lang('ACTIONS')}</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="links" item="vo">
                                <tr>
                                    <td>
                                        <input lay-skin="primary" type="checkbox" class="js-check" lay-filter="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}">
                                    </td>
                                    <td><input name='list_orders[{$vo.id}]' class="input input-order mr5" type='text' size='3'
                                               value='{$vo.list_order}'></td>
                                    <td>{$vo.id}</td>
                                    <td>{$vo.name}</td>
                                    <td><a href="{$vo.url}" target="_blank">{$vo.url}</a></td>
                                    <td>
                                        <empty name="vo.status">
                                            <span class="layui-badge-dot layui-bg-abnormal" style="margin-right: 6px;"></span>{$status[$vo['status']]}
                                            <else/>
                                            <span class="layui-badge-dot layui-bg-function" style="margin-right: 6px;"></span>{$status[$vo['status']]}
                                        </empty>
                                    </td>
                                    <td>
                                        <a class="layui-bo layui-bo-small layui-bo-checked" href="javascript:admin.openIframeLayer('{:url('link/edit',array('id'=>$vo['id']))}','编辑',{btn: ['保存','关闭'],area:['640px','50%'],end:function(){location.reload();}});">{:lang('EDIT')}</a>
                                        <div class="new-divider new-divider-vertical"></div>
                                        <a class="layui-bo layui-bo-small layui-bo-close js-ajax-delete" href="{:url('link/delete',array('id'=>$vo['id']))}">
                                            {:lang('DELETE')}
                                        </a>
                                    </td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<include file="public@script"/>
</body>
</html>